import { http } from 'utils'

export async function getSite() {
  try {
    const res = await http.get('website/info')
    if (res.code === 1) {
      const data = res.data
      return data
    }
    throw res.info
  } catch (err) {
    throw err
  }
}

export async function saveSite(payload) {
  const path = 'website/update'
  try {
    const res = await http.post(path, payload)
    if (res.code === 1) {
      return res
    }
    throw res.info
  } catch (err) {
    throw err
  }
}
